Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Etablert tilsyn forbedringer #7140

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

hallvardastark
Copy link
Collaborator

No description provided.

@hallvardastark hallvardastark requested a review from a team as a code owner February 24, 2025 12:22
@hallvardastark hallvardastark requested a review from Copilot March 11, 2025 09:15

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR introduces improvements and refactoring for the established oversight (etablert tilsyn) feature. Key changes include:

  • Updating Storybook stories to use function mocks (fn) and enhanced play function steps.
  • Refactoring data fetching in EtablertTilsynContainer to use react-query along with transformation functions and removing the old reducer approach.
  • Adjustments in UI components for better type safety and optional chaining, as well as improvements to component prop definitions and return types.

Reviewed Changes

File Description
packages/fakta-etablert-tilsyn/src/ui/EtablertTilsyn.stories.tsx Updated import and story configuration with function mocks.
packages/fakta-etablert-tilsyn/src/ui/components/etablertTilsyn/EtablertTilsynMedSmoring.tsx Improved type declarations and simplified unique array extraction.
packages/fakta-etablert-tilsyn/src/ui/EtablertTilsynContainer.tsx Migrated from reducer-based state management to react-query for data fetching.
packages/fakta-etablert-tilsyn/src/ui/components/etablertTilsyn/EtablertTilsynDag.tsx Made timer and kilde optional and updated rendering of icons accordingly.
packages/fakta-etablert-tilsyn/src/util/dateUtils.ts Adjusted plugin import order and added explicit type annotations.
Other files Various adjustments for type-safety, conditional rendering, and removal of deprecated files (mainReducer and mainActionTypes).

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

packages/fakta-etablert-tilsyn/src/ui/components/vurderingsperiode/VurderingsperiodeElement.tsx:16

  • The renderStatusIcon function does not handle a null 'resultat' value. Consider adding a null check or a default icon to prevent unintended behavior when 'resultat' is null.
resultat: Vurderingsresultat | null;

packages/fakta-etablert-tilsyn/src/ui/mainReducer.ts:1

  • The mainReducer file is completely removed. Ensure that no residual references in the codebase remain that depend on this reducer and that all components have been updated to use the new react-query based data fetching.
import { Period } from '@fpsak-frontend/utils';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants